{% assign current = 'Swift 5.1 (Xcode 11.3.1)' %}
{% for version in site.data.versions %}
    {% if page.url contains version.path %}
        {% capture current %}{{ version.name }} ({{ version.note }}){% endcapture %}
    {% endif %}
{% endfor %}
    <div class="dropdown">
        <button class="btn btn-default dropdown-toggle" type="button" id="versionMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
            {{ current }}
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="versionMenu">
        {% for version in site.data.versions %}
            {% if version.dropdown %}
                <li><a href="{{ version.path }}">{{ version.name }} ({{ version.note }})</a></li>
            {% endif %}
        {% endfor %}
            <li role="separator" class="divider"></li>
            <li><a href="/versions">More information</a></li>
         </ul>
    </div>
